home *** CD-ROM | disk | FTP | other *** search
- Path: comma.rhein.de!serpens!not-for-mail
- From: mlelstv@serpens.rhein.de (Michael van Elst)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: MsgPorts
- Date: 16 Jan 1996 01:47:33 +0100
- Organization: dis-
- Message-ID: <4desj5$bi8@serpens.rhein.de>
- References: <2005.6588T1264T489@Th0r.foo.bar>
- NNTP-Posting-Host: serpens.rhein.de
-
- christon (Christopher Naas) writes:
-
- > if (mymsgport = AllocVec (sizeof (struct MsgPort), MEMF_ANY|MEMF_CLEAR))
- > {
- > if (mymsgport = CreateMsgPort ())
-
- This overwrites the mymsgport pointer.
-
- > PutMsg (mymsgport, (struct Message *)kmsg);
-
- This sends the message without making sure that it isn't reused. Send it
- twice and you are dead.
-
- > ReplyMsg ((struct Message *)kmsg);
-
- This kills the system as the message has no valid replyport.
-
- > FreeVec (mymsgport);
-
- Here you reuse the overwritten pointer and free memory twice, even with invalid
- size information.
-
-
- --
- Michael van Elst
-
- Internet: mlelstv@serpens.rhein.de
- "A potential Snark may lurk in every tree."
-